<template>
    <!-- 
    <b-modal ref="my-modal" hide-footer title="Using Component Methods">
     <div class="d-block text-center">
       <h3>Hello From My Modal!</h3>
     </div>
     <b-button class="mt-3" variant="outline-danger" block @click="hideModal">Close Me</b-button>
     <b-button class="mt-2" variant="outline-warning" block @click="toggleModal">Toggle Me</b-button>
   </b-modal> 
    -->
    <!--
        body-class="modalStyle" 表示样式
        size="lg" 表示模态窗口大小 xl,lg,sm,full
        hide-footer 表示隐藏底部按钮
        hide-header 表示隐藏头部内容
        no-close-on-backdrop 表示鼠标点击背景不可关闭
        hide-header-close 表示隐藏头部关闭按钮
        centered 居中
        ok-title=“确定” 
        cancel-title=取消
        @ok="handleOk" 
        @cancel="handleCancel"
        scrollable 滚动条
        hide-backdrop 隐藏背景
        wrapClassName="ant-modal-cust-warp" 
        style="top:5%;height: 85%;overflow-y: hidden" 样式
    -->
    <b-modal ref="my-modal" size="xl" :title="title" hide-footer scrollable no-close-on-backdrop>
        <div class="d-block text-center">
            <b-card no-body>
                <!--配置参数：
                    small:表示小号
                    pills:清爽型
                    no-body
                    card:卡片布局
                -->
                <b-tabs card>
                    <b-tab active>                        
                        <template v-slot:title>
                            <b-spinner type="grow" small></b-spinner><strong>待分配账户</strong>
                        </template>
                        <OauthStayUserRole :roleData="roleData"></OauthStayUserRole>     
                    </b-tab>
                    <b-tab>
                        <template v-slot:title>
                            <b-spinner type="grow" small></b-spinner><strong>已分配账户</strong>
                        </template>
                        <OauthAlreadyUserRole :roleData="roleData"></OauthAlreadyUserRole>  
                    </b-tab>
                </b-tabs>
            </b-card>
        </div>
        <template slot="modal-footer">
            <!--自定义按钮-->
        </template>
    </b-modal>      
      
</template>
<script>
import apiUtil from "@/core/util/apiUtil.js"; 
import OauthStayUserRole from "@/view/oauth/oauth-role/oauth-user-role-stay.vue";
import OauthAlreadyUserRole from "@/view/oauth/oauth-role/oauth-user-role-already.vue";
import { handleNotify,handleAlert,handleConfirm,showWating,closeWating} from "@/core/util/jehcUtil.js";
export default {
    data(){
        return {    
            tabPosition: 'left',
            title:'角色权限->分配账户->',
            roleData: {}
        }
    },
    components: {
        OauthStayUserRole,
        OauthAlreadyUserRole
    },
    watch: {
    },
    mounted() {
    },
    methods: {        
        showModal(row) {       
            console.log(row);    
            this.$refs['my-modal'].show();
            this.roleData = row;
            this.title = '角色权限->分配账户->'+row.name+"";
        },
        hideModal() {
            console.log("-----------");
            this.$refs['my-modal'].hide();
        },
        toggleModal() {
            // 当模态已隐藏时，我们传递要返回焦点的按钮的ID
            this.$refs['my-modal'].toggle('#toggle-btn')
        },
   }
}
</script>